package hypernexusclient

import (
	"github.com/TarsCloud/TarsGo/tars"
	"github.com/wzh200x/hyperNexus/hyperNexusProtocol/interfaceServerProtocol" // 假设的协议包路径
)

type InterfaceServerClient struct {
	Proxy tars.ProxyPrx
}

func (c *InterfaceServerClient) Init(comm *tars.Communicator) error {
	cfg := tars.GetServerConfig()
	conf := tars.GetConf()
	// 假设 CacheServer 的对象名称和配置路径
	objName := conf.GetStringWithDef("/tars/application<InterfaceServer>", cfg.App+"."+"InterfaceServer"+".InterfaceServerOperateObj")
	c.Proxy = new(interfaceServerProtocol.InterfaceServer) // 假设的协议接口名称
	comm.StringToProxy(objName, c.Proxy)
	return nil
}

func (c *InterfaceServerClient) GetClientProxy() *interfaceServerProtocol.InterfaceServer { // 假设的协议接口名称
	return c.Proxy.(*interfaceServerProtocol.InterfaceServer) // 假设的协议接口名称
}

func NewInterfaceServerClient() *InterfaceServerClient {
	return &InterfaceServerClient{}
}
